package jdbc3_25.homework;

import java.sql.Connection;
import java.sql.Statement;

public class JDBCDemo03 {
    public static void main(String[] args) {
        try(Connection connection = DBUtil01.getConnection();){
            Statement statement = connection.createStatement();
            String sql =  "UPDATE user1 " +
                    "SET password='666666',nickname='老三',age=50 " +
                    "WHERE id=1";
            int num = statement.executeUpdate(sql);
            if (num > 0){
                System.out.println("修改成功");
            }else {
                System.out.println("修改失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
    }
}
}